using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class FurnitureMenu : MonoBehaviour
{
   

    public GameObject buildFurnitureButtonPrefab;
    // Start is called before the first frame update
    void Start()
    {
        BuildController bmc = FindObjectOfType<BuildController>();
        foreach (string furnitureType in WorldController.Instance.world.TypeFurnitureMap.Keys)
        {
            GameObject go = Instantiate(buildFurnitureButtonPrefab);
            go.transform.SetParent(this.transform);
            go.name = "Button - Build" + furnitureType;
            go.GetComponentInChildren<TMP_Text>().text = furnitureType;
            Button button = go.GetComponent<Button>();

            button.onClick.AddListener(delegate { bmc.setMode_BuildInstalledObect(furnitureType); });
        }
    }

}
